<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">广告管理</h4>
</div>
<div class="wrapper-md ng-scope" ng-controller="advertisementCtrl">
    <div class="panel panel-default">
        <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline ng-pristine ng-valid">
                    <div class="form-group" ng-controller="advertisementTypeSelectCtrl">
                        <label class="control-label">广告类型:</label>
                        <select class="input-sm form-control" ng-model="advertise.advertiseTypeId">
                            <option  value="">请选择广告类型</option>
                            <option ng-repeat="s in selectList" value="{{s.id}}">{{s.name}}</option>
                        </select>
                    </div>
                    <button class="btn btn-sm btn-default" ng-click="query()">查询</button>
                </form>
            </div>
            <div class="col-sm-3">
                <div class=" pull-right">
                    <a class="btn btn-sm btn-info" ui-sref="app.advertisementDetailInfoAdd" target="_blank">添加广告</a>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th width="600">广告图片</th>
                    <th width="600">链接</th>
                    <th>排序</th>
                    <th>状态</th>
                    <th width="200" class="text-center">操作</th>
                </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="a in list">
                        <td>
                            <img src="{{app.image.advertise}}{{a.imgUrl}}">
                        </td>
                        <td  style="word-break:break-all">{{a.advertiseUrl}}</td>
                        <td>{{a.sort}}</td>
                        <td>
                            <span class="badge bg-success" ng-if="a.status == 0">上架</span>
                            <span class="badge bg-danger" ng-if="a.status == 1">下架</span>
                        </td>
                        <td class="t-btns text-center" width="200">
                            <a class="btn btn-sm btn-success" ui-sref="app.advertisementDetailInfo({id:a.id})" target="_blank">查看</a>
                            <a class="btn btn-sm btn-info" ui-sref="app.advertisementDetailInfoEdit({id:a.id})" target="_blank">修改</a>
                            <div class="btn-group dropdown" dropdown="">
                                <button class="btn btn-sm btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li ng-if="a.status == 0"><a  ng-click="changeStatus(a.id)">下架</a></li>
                                    <li ng-if="a.status == 1"><a  ng-click="changeStatus(a.id)">上架</a></li>
                                    <li class="divider"></li>
                                    <li><a ng-click="openDelete(a.id)">删除</a></li>
                                </ul>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 hidden-xs">
                </div>
                <div class="col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>
</div>
